
import 'package:json_annotation/json_annotation.dart';
part 'user_info_result.g.dart';

@JsonSerializable()
class UserInfoResult{
  final String guid;
  final String username;
  final String lan;
  @JsonKey(name: 'is_admin')
  final int isAdmin;
  @JsonKey(name: 'last_login_time')
  final int lastLoginTime;
  final List<Sources> sources;

  UserInfoResult(this.guid, this.username, this.lan, this.isAdmin, this.lastLoginTime, this.sources);

  factory UserInfoResult.fromJson(Map<String, dynamic> json) => _$UserInfoResultFromJson(json);
}

@JsonSerializable()
class Sources{
  final String source;
  @JsonKey(name:'source_id')
  final String sourceId;
  @JsonKey(name: 'source_name')
  final String sourceName;

  Sources(this.source, this.sourceId, this.sourceName);

  factory Sources.fromJson(Map<String, dynamic> json) => _$SourcesFromJson(json);
}